package com.qhong.event;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

/**
 * Created by qhong on 2018/8/1 11:00
 * https://blog.csdn.net/liaokailin/article/details/48186331
 **/
public class MyApplicationStartedEventListener implements ApplicationListener<ApplicationStartedEvent> {

	private Logger logger = LoggerFactory.getLogger(MyApplicationStartedEventListener.class);

	@Override
	public void onApplicationEvent(ApplicationStartedEvent event) {
		SpringApplication app = event.getSpringApplication();
		app.setBannerMode(Mode.OFF);// 不显示banner信息
		logger.info("==MyApplicationStartedEventListener==");
	}
}